package hydrap2p.gui.commands;

import hydrap2p.gui.GUIDataHandler;
import hydrap2p.gui.GUIViewHandler;

import java.util.ArrayList;

public class Cmd_GUIViewHandler_SavePreferences implements Command {

	@Override
	public void execute() {
		ArrayList<String> prefs = new ArrayList<String>();
		prefs.add(GUIViewHandler.getInstance().getFrameWidth() + "");
		prefs.add(GUIViewHandler.getInstance().getFrameHeight() + "");
		prefs.add(GUIViewHandler.getInstance().getHorizontalDividerPercentage() + "");
		prefs.add(GUIViewHandler.getInstance().getVerticalDividerPercentage() + "");
		prefs.add(GUIDataHandler.DOWNLOAD_PATH);
		
		GUIDataHandler.getInstance().savePreferences(prefs);
		
		System.out.println(getCommand());
	}

	@Override
	public String getCommand() {
		return this.getClass().getSimpleName();
	}

	@Override
	public void unexecute() {
		// TODO Auto-generated method stub

	}

}
